package org.dylan.web.tag.css;

import java.util.ArrayList;
import java.util.List;

/**
 * CSS数据模型
 * 
 * @author dylan
 * 
 */
public class CSSModel {
	/**
	 * 标识当前css
	 */
	private String id;

	private List<CSSTheme> themeList = new ArrayList<CSSTheme>();

	public CSSTheme getTheme(String theme) {
		for (CSSTheme th : themeList) {
			if (theme.equals(th.theme)) {
				return th;
			}
		}
		return null;
	}

	public void addTheme(CSSTheme theme){
		if(theme != null){
			themeList.add(theme);
		}
	}

	static class CSSTheme {
		private String path;
		private String theme;

		public String getPath() {
			return path;
		}

		public void setPath(String path) {
			this.path = path;
		}

		public String getTheme() {
			return theme;
		}

		public void setTheme(String theme) {
			this.theme = theme;
		}

		@Override
		public String toString() {
			return "CSSTheme [" + theme + ":" + path + "]";
		}

	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Override
	public String toString() {
		return "CSS[" + id + "]themeList=" + themeList;
	}
}
